//
//  MSFinancialRoomManagementController.m
//  觅尚
//
//  Created by No.8 on 2019/4/5.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSFinancialRoomManagementController.h"
#import "MSRoomConsumOtionCell.h"
#import "MSFinancialAdministrationController.h"
#import "MSConsumptionModel.h"
#import "MSPrincessessModel.h"
#import "MSPreciousSaleInfoModel.h"
#import "MSRoomaiterModel.h"

@interface MSFinancialRoomManagementController ()<UITableViewDelegate,UITableViewDataSource>
//通用导航栏
{
    CustomNavigationBar *naviagtionBar;
    
}
/** 表视图*/
@property(nonatomic,strong)UITableView *tableView;


/** 表视图*/
@property(nonatomic,strong)UIView *HeaderView;


/** 取反*/
@property(nonatomic,strong)UIButton *typeButton;

/** 遮盖层*/
@property(nonatomic,strong)UIView *backView;


/** 弹出View*/
@property(nonatomic,strong)UIView *showView;


/** 数组*/
//@property(nonatomic,strong)NSMutableArray *preciousSaleInfoArray;

/** 更新时间*/
@property(nonatomic,strong)UILabel * updatetimeLabel;


/** 房间状态*/
@property(nonatomic,strong)UILabel * ConsumptionLabel;


/** 房间消费总金额*/
@property(nonatomic,strong)UILabel * ConsumptionStatisticsLabel;


/** 金额*/
@property(nonatomic,strong)UITextField *TotalConsumptionField;

/** 金额*/
@property(nonatomic,strong)UILabel * BackConsumptionStatisticsLabel;


/** 挂账*/
@property(nonatomic,strong)UITextField *AccountsTextField;


/** 挂账*/
@property(nonatomic,strong)UITextField *zhaodaiTextField;


/** 挂账*/
@property(nonatomic,strong)UIButton *ZhaodaiButton;

/** 微信*/
@property(nonatomic,strong)UITextField *WeChatTextField;


/** 刷卡*/
@property(nonatomic,strong)UITextField *PaybycardTextField;

/** 会员卡支付*/
@property(nonatomic,strong)UITextField *MembershipcardTextField;


/** 支付宝*/
@property(nonatomic,strong)UITextField *AlipayTitleTextField;


/** 现金*/
@property(nonatomic,strong)UITextField *CashTextField;


/** 房间收益*/
@property(nonatomic,strong)NSString *totalIncome;



/** 房间号  消费*/
@property(nonatomic,strong)NSMutableArray *DataArray;


/** 房间号  消费*/
@property(nonatomic,strong)NSMutableArray *preciousSaleInfoArray;

/** 房间号  消费*/
@property(nonatomic,strong)NSMutableArray *MSPrincessessArray;

/** 状态*/
//@property(nonatomic,strong)UILabel *ConsumptionLabel;

/** 是否为招待房间*/
@property(nonatomic,strong)UILabel *EntertainLabel;

/** 是否为招待房间*/
@property(nonatomic,strong)NSString *HouseownerIMG;

/** 是否为招待房间*/
@property(nonatomic,strong)NSString *HouseownerLabel;

/** 是否为招待房间*/
@property(nonatomic,strong)NSString *WaiterIMG;

/** 是否为招待房间*/
@property(nonatomic,strong)NSString *WaiterNameLabel;

/** <#name#>*/
@property(nonatomic,strong)UILabel *CurrentConsumptionView;

@end

@implementation MSFinancialRoomManagementController
/** Nav实现 */
- (int)navBarBottom {
    if ([WRNavigationBar isIphoneX]) {
        return 88;
    } else {
        return 64;
    }
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
    self.view.backgroundColor = backgroundcolor;
    self.DataArray = [NSMutableArray new];
    self.preciousSaleInfoArray = [NSMutableArray new];
    self.MSPrincessessArray = [NSMutableArray new];
    Prepare *header = [Prepare headerWithRefreshingTarget:self refreshingAction:@selector(MJChiBaoZiHeaderRefresh)];
    // 隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES;
    header.stateLabel.hidden = YES;
    // 马上进入刷新状态
    self.tableView.mj_header = header;
    [self.tableView.mj_header beginRefreshing];
}
- (void)MJChiBaoZiHeaderRefresh{
    
     [self ReloadData];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self CreateNavigationBar];
    
   
    
    [self tableView];
}
- (void)ReloadData{
    
    NSDate *date=[NSDate date];
    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
    [format1 setDateFormat:@"hh:mm"];
    NSString *dateStr;
    dateStr = [format1 stringFromDate:date];
    self.updatetimeLabel.text = [NSString stringWithFormat:@"更新时间：%@",dateStr];
    
    [MBManager showLoading];
    
    [self.DataArray removeAllObjects];
    [self.preciousSaleInfoArray removeAllObjects];
    [self.MSPrincessessArray removeAllObjects];
    
    NSDictionary * params = @{@"roomId":self.roomid,@"uid":[WYCAccountTool unarchiveuid]};
    WYCLog(@"%@",params);
    [HTTPRequest POST:MSgetByIdRoom params:params succeed:^(id responseObject) {
        WYCLog(@"%@",responseObject);
        WYCLog(@"%@",responseObject[@"msg"]);
        
        
        
        if (CodeStr) {
            [MBManager hideAlert];
            [self.tableView.mj_header endRefreshing];
            
            for (NSDictionary * dict in responseObject[@"data"]) {
                [self.tableView.mj_header endRefreshing];
                MSConsumptionModel * model = [MSConsumptionModel mj_objectWithKeyValues:dict];
                [self.DataArray addObject:model];
                self.totalIncome = [NSString stringWithFormat:@"%@",model.sumMoney];
//                self.ConsumptionStatisticsLabel.text = [NSString stringWithFormat:@"%@",model.sumMoney];
//
//                self.BackConsumptionStatisticsLabel.text = [NSString stringWithFormat:@"%@",model.sumMoney];
                self.MSPrincessessArray = [MSPrincessessModel mj_objectArrayWithKeyValuesArray:model.princessess];
                self.preciousSaleInfoArray = [MSPreciousSaleInfoModel mj_objectArrayWithKeyValuesArray:model.preciousSaleInfo];
                for (NSDictionary * dict  in model.waiter) {
                    self.WaiterIMG = [NSString stringWithFormat:@"%@",dict[@"avatarUrl"]];
                    self.WaiterNameLabel = [NSString stringWithFormat:@"%@",dict[@"userName"]];
                    
                }
            }
        }else{
            
            [MBManager hideAlert];
            [MBManager showBriefAlert:responseObject[@"msg"]];
            [self.tableView.mj_header endRefreshing];
        }
         [self CreatView];
        [self.tableView reloadData];
    } failure:^(NSError *error) {
        [self.tableView.mj_header endRefreshing];
        [MBManager hideAlert];
        [MBManager showBriefAlert:Failed];
    }];
    
}
- (void)CreatView{
    
    UIView * HeaderView = [[UIView alloc] init];
    HeaderView.x = 0;
    HeaderView.y = 0;
    HeaderView.width = ScreenWidth;
    HeaderView.backgroundColor = backgroundcolor;
    
    /** 房间总量*/
    UILabel * totleCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(40 * px, 40 * px, ScreenWidth / 3 * 2, 80 * px)];
    totleCountLabel.textColor = [UIColor whiteColor];
    totleCountLabel.text = [NSString stringWithFormat:@"房间%@     ￥%@",self.roomName,self.totalIncome];
    totleCountLabel.textAlignment = NSTextAlignmentLeft;
    totleCountLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [HeaderView addSubview:totleCountLabel];
    
    
    /** 超消费标签*/
    UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth - 180 * px, totleCountLabel.y, 150 * px, 60 * px)];
    ConsumptionLabel.textColor = [UIColor whiteColor];
    ConsumptionLabel.text = @"超消费";
    ConsumptionLabel.textAlignment = NSTextAlignmentCenter;
    ConsumptionLabel.layer.cornerRadius = 40 * px;
    ConsumptionLabel.backgroundColor = WYCRGBColor(224, 93, 49);
    ConsumptionLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [HeaderView addSubview:ConsumptionLabel];
    self.ConsumptionLabel = ConsumptionLabel;
    
    
    
    UIView * LineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(ConsumptionLabel.frame) + 20 * px, HeaderView.width, 1)];
    LineView.backgroundColor = BackViewColor;
    [HeaderView addSubview:LineView];
    
    
    /** 日历按钮*/
    UIImageView * titleIMG = [[UIImageView alloc] initWithFrame:CGRectMake(totleCountLabel.x, CGRectGetMaxY(LineView.frame) + 30 * px, 60 * px, 60 * px)];
    titleIMG.image = [UIImage imageNamed:@"消费"];
//    titleIMG.layer.cornerRadius = 30 * px;
    [HeaderView addSubview:titleIMG];
    
    
    /** 消费详情标题*/
    UILabel * Consumptiondetails = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(titleIMG.frame) + 20 * px, titleIMG.y, 200 * px, titleIMG.height)];
    Consumptiondetails.textColor = [UIColor grayColor];
    Consumptiondetails.text = @"消费详情";
    Consumptiondetails.textAlignment = NSTextAlignmentLeft;
    Consumptiondetails.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [HeaderView addSubview:Consumptiondetails];
    
    /** 日历按钮*/
    UIImageView * UpdateIMG = [[UIImageView alloc] initWithFrame:CGRectMake(HeaderView.width - 440 * px, titleIMG.y, titleIMG.width, titleIMG.height)];
    UpdateIMG.image = [UIImage imageNamed:@"gxsj_icon"];
    //    titleIMG.layer.cornerRadius = 30 * px;
    [HeaderView addSubview:UpdateIMG];
    
    
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"HH:mm"];
    NSDate *datenow1 = [NSDate date];
    NSString *currentTimeString = [formatter stringFromDate:datenow1];
    
    /** 消费详情标题*/
    UILabel * updatetimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(HeaderView.width - 380 * px, titleIMG.y, 340 * px, titleIMG.height)];
    updatetimeLabel.textColor = WYCRGBColor(74, 161, 164);
    updatetimeLabel.text = [NSString stringWithFormat:@"更新时间%@",currentTimeString];
    updatetimeLabel.textAlignment = NSTextAlignmentRight;
    updatetimeLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [HeaderView addSubview:updatetimeLabel];
    self.updatetimeLabel = updatetimeLabel;
    
    UIView * titleView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(titleIMG.frame) + 30 * px, HeaderView.width, 120 * px)];
    titleView.backgroundColor = BackViewColor;
    [HeaderView addSubview:titleView];
    NSArray * titleArray = @[@"图片",@"名称",@"单价",@"数量",@"总价"];
    
    CGFloat CommoditytitleWidth = HeaderView.width / titleArray.count;
    CGFloat CommoditytitleY = 0;
    CGFloat CommoditytitleHeight = titleView.height;
    for (int index = 0; index < titleArray.count; index ++) {
        /** 标题label*/
        UILabel * Commoditytitle = [[UILabel alloc] init];
        Commoditytitle.x = CommoditytitleWidth * index;
        Commoditytitle.y = CommoditytitleY;
        Commoditytitle.width = CommoditytitleWidth;
        Commoditytitle.height = CommoditytitleHeight;
        Commoditytitle.textColor = WYCRGBColor(102, 121, 145);
        Commoditytitle.text = titleArray[index];
        Commoditytitle.textAlignment = NSTextAlignmentCenter;
        Commoditytitle.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
        [titleView addSubview:Commoditytitle];
    }
    
    
    HeaderView.height = CGRectGetMaxY(titleView.frame);
    [self.view addSubview:HeaderView];
    self.HeaderView = HeaderView;
    self.tableView.tableHeaderView = HeaderView;
    
    
    
    UIView * BottomView = [[UIView alloc] initWithFrame:CGRectMake(0, ScreenHeight - 400 * px, ScreenWidth, 400 * px)];
    BottomView.backgroundColor = self.view.backgroundColor;
//    BottomView.backgroundColor = [UIColor redColor];
    [self.view addSubview:BottomView];
    
    
    
    
    
    
    /** 消费统计*/
    UIButton * ConsumptionStatisticsButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, BottomView.width, BottomView.height * 0.5)];
    ConsumptionStatisticsButton.backgroundColor = [UIColor whiteColor];
    [ConsumptionStatisticsButton  addTarget:self action:@selector(ConsumptionClick) forControlEvents:UIControlEventTouchUpInside];
    [BottomView  addSubview:ConsumptionStatisticsButton];
    //设置所需的圆角位置以及大小
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:ConsumptionStatisticsButton.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = ConsumptionStatisticsButton.bounds;
    maskLayer.path = maskPath.CGPath;
    ConsumptionStatisticsButton.layer.mask = maskLayer;
    
    
    UIView * ButtonView = [[UIView alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 50 * px, 10 * px, 100 * px, 20 * px)];
    //    ButtonView.backgroundColor = self.view.backgroundColor;
    ButtonView.layer.cornerRadius = 5 * px;
    ButtonView.backgroundColor = WYCRGBColor(216, 216, 216);
    [BottomView addSubview:ButtonView];
    
    
    /** 消费统计总额*/
    UILabel * ConsumptionStatisticsTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 80 * px, BottomView.width / 2, 60 * px)];
    ConsumptionStatisticsTitle.textColor = [UIColor blackColor];
    ConsumptionStatisticsTitle.text = @"消费统计总额";
    ConsumptionStatisticsTitle.textAlignment = NSTextAlignmentLeft;
    ConsumptionStatisticsTitle.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [ConsumptionStatisticsButton addSubview:ConsumptionStatisticsTitle];
    
    
    /** 消费统计总额*/
    UILabel * ConsumptionStatisticsLabel = [[UILabel alloc] initWithFrame:CGRectMake(BottomView.width / 2 , ConsumptionStatisticsTitle.y, BottomView.width / 2 - 40 * px, ConsumptionStatisticsTitle.height)];
    ConsumptionStatisticsLabel.textColor = FontColor;
//    ConsumptionStatisticsLabel.text = @"￥9300";
    ConsumptionStatisticsLabel.text = [NSString stringWithFormat:@"￥%@",self.totalIncome];
    ConsumptionStatisticsLabel.textAlignment = NSTextAlignmentRight;
    ConsumptionStatisticsLabel.font = ConsumptionStatisticsTitle.font;
    [ConsumptionStatisticsButton addSubview:ConsumptionStatisticsLabel];
    self.ConsumptionStatisticsLabel = ConsumptionStatisticsLabel;
    
    /** 确定按钮*/
    UIButton * DetermineButton = [UIButton buttonWithType:UIButtonTypeCustom];
    DetermineButton.frame = CGRectMake(0, CGRectGetMaxY(ConsumptionStatisticsButton.frame), ConsumptionStatisticsButton.width, ConsumptionStatisticsButton.height);
    [DetermineButton setTitle:@"确认" forState:UIControlStateNormal];
    [DetermineButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [DetermineButton setBackgroundImage:[UIImage imageNamed:@"底部按钮背景"] forState:UIControlStateNormal];
    DetermineButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(34 / 2)];
    [DetermineButton addTarget:self action:@selector(DetermineButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [BottomView  addSubview:DetermineButton];
    
    
    
    
    
    
}
/** 表视图*/
- (UITableView *)tableView{
    self.extendedLayoutIncludesOpaqueBars = YES;
    if (!_tableView) {
        
        if (@available(iOS 11.0, *)) {
            
            _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
            
        } else {
            
            self.automaticallyAdjustsScrollViewInsets = NO;
            
        }
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, [self navBarBottom], ScreenWidth, ScreenHeight - [self navBarBottom] - self.HeaderView.height - 400 * px) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self.view addSubview:self.tableView];
    }
    return _tableView;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.preciousSaleInfoArray.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 140 * px;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    MSRoomConsumOtionCell * cell = [MSRoomConsumOtionCell cellWithTableView:tableView];
    tableView.backgroundColor = [UIColor clearColor];
    //无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    //    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    cell.PrincessessModel = self.preciousSaleInfoArray[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//    MSFinancialAdministrationController * AdministrationVC = [[MSFinancialAdministrationController alloc] init];
//    [self.navigationController pushViewController:AdministrationVC animated:NO];
    
}
- (void)CreateNavigationBar{
    
    self.view.backgroundColor = backgroundcolor;
    naviagtionBar = [[CustomNavigationBar alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, [self navBarBottom])];
    [self.view addSubview:naviagtionBar];
    naviagtionBar.titleLabel.text = @"房间结算";
    naviagtionBar.rightBtn.hidden = YES;
    naviagtionBar.rightBtnTitle.hidden = YES;
    [self.view addSubview:naviagtionBar];
    
    [naviagtionBar.leftBtn setImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
    [naviagtionBar.leftBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    
}

//确认
- (void)DetermineButtonClick{
    
    WYCLogFunc;
    /***************** 剔除空格************/
    NSString *TotalConsumptionStr = [self.TotalConsumptionField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *WeChatStr = [self.WeChatTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *MembershipcardStr = [self.MembershipcardTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *AlipayTitleStr = [self.AlipayTitleTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *PaybycardStr= [self.PaybycardTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *AccountsStr= [self.AccountsTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSString *Cashtr= [self.CashTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
//    NSString *zhaodaitr= [self.zhaodaiTextField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    int summer = [WeChatStr intValue] + [MembershipcardStr intValue] + [AlipayTitleStr intValue] + [PaybycardStr intValue] + [AccountsStr intValue] + [Cashtr intValue];
    if (TotalConsumptionStr.length == 0) {
        [MBManager showBriefAlert:@"消费结算金额不能为空"];
        return;
    }
    if (summer != [TotalConsumptionStr intValue]) {
        [MBManager showBriefAlert:@"结算金额不正确"];
        return;
    }
    NSString * isEntertainStr = @"";
    if (self.ZhaodaiButton.selected == YES) {
        isEntertainStr = @"1";
    }else{
        isEntertainStr = @"0";
        
    }
    NSDictionary *params = @{@"roomId":self.roomid,@"totalIncome":TotalConsumptionStr,@"weChatPay":WeChatStr,@"membershipPay":MembershipcardStr,@"aliPay":AlipayTitleStr,@"bankCardPay":PaybycardStr,@"accountingMoney":AccountsStr,@"cashPay":Cashtr,@"answerMoney":self.totalIncome,@"isEntertain":isEntertainStr};
    WYCLog(@"========%@",params);
    [HTTPRequest POST:MSaddRoomRecord params:params succeed:^(id responseObject) {
        WYCLog(@"========%@",responseObject);
        if (CodeStr) {
            [self.backView removeFromSuperview];
            [MBManager showBriefAlert:responseObject[@"msg"]];
        }else{
            [self.backView removeFromSuperview];
            [MBManager showBriefAlert:responseObject[@"msg"]];
        }
    } failure:^(NSError *error) {
        [MBManager showBriefAlert:Failed];
    }];
    
    
}

//弹出
- (void)ConsumptionClick{
    
    WYCLogFunc;
    UIView * view = [[UIView alloc] init];
    view.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight - 200 * px);
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    [[UIApplication sharedApplication].keyWindow  addSubview:view];
    self.backView = view;
    
    
    UIView * showView = [[UIView alloc] init];
    showView.frame = CGRectMake(0, ScreenHeight / 2 - 300 * px, ScreenWidth , ScreenHeight / 2 + 100 * px);
    showView.backgroundColor = [UIColor whiteColor];
    [view addSubview:showView];
    self.showView = showView;
    //设置所需的圆角位置以及大小
    UIBezierPath * showViewmaskPath = [UIBezierPath bezierPathWithRoundedRect:showView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer * showViewmaskLayer = [[CAShapeLayer alloc] init];
    showViewmaskLayer.frame = showView.bounds;
    showViewmaskLayer.path = showViewmaskPath.CGPath;
    showView.layer.mask = showViewmaskLayer;
    
    UIButton * BackButton = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 50 * px, 10 * px, 100 * px, 20 * px)];
//    [BackButton addTarget:self action:@selector(BackButtonClick) forControlEvents:UIControlEventTouchUpInside];
    BackButton.layer.cornerRadius = 5 * px;
    BackButton.backgroundColor = DividinglineColor;
    [showView addSubview:BackButton];
    
    
    
    UIButton * BackButton1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, showView.width, 100 * px)];
    [BackButton1 addTarget:self action:@selector(BackButtonClick) forControlEvents:UIControlEventTouchUpInside];
    BackButton1.layer.cornerRadius = 5 * px;
    BackButton1.backgroundColor = [UIColor clearColor];
    [showView addSubview:BackButton1];
    
    
    /** 消费统计总额*/
    UILabel * BackConsumptionStatisticsTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 80 * px, showView.width / 2, 60 * px)];
    BackConsumptionStatisticsTitle.textColor = [UIColor blackColor];
    BackConsumptionStatisticsTitle.text = @"消费统计总额";
    BackConsumptionStatisticsTitle.textAlignment = NSTextAlignmentLeft;
    BackConsumptionStatisticsTitle.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [showView addSubview:BackConsumptionStatisticsTitle];
    
    
    /** 消费统计总额*/
    UILabel * BackConsumptionStatisticsLabel = [[UILabel alloc] initWithFrame:CGRectMake(showView.width / 2 , BackConsumptionStatisticsTitle.y, showView.width / 2 - 40 * px, BackConsumptionStatisticsTitle.height)];
    BackConsumptionStatisticsLabel.textColor = FontColor;
    BackConsumptionStatisticsLabel.text = [NSString stringWithFormat:@"￥%@",self.totalIncome];
    BackConsumptionStatisticsLabel.textAlignment = NSTextAlignmentRight;
    BackConsumptionStatisticsLabel.font = BackConsumptionStatisticsTitle.font;
    [showView addSubview:BackConsumptionStatisticsLabel];
    
    UIView * ConsumptionLineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(BackConsumptionStatisticsLabel.frame) + 30 * px, showView.width, 1)];
    ConsumptionLineView.backgroundColor = DividinglineColor;
    [showView addSubview:ConsumptionLineView];
    self.BackConsumptionStatisticsLabel = BackConsumptionStatisticsLabel;
    
    
    /** 消费统计总额*/
    UILabel * TotalConsumptionTitle = [[UILabel alloc] initWithFrame:CGRectMake(BackConsumptionStatisticsTitle.x, CGRectGetMaxY(ConsumptionLineView.frame) + 30 * px, BackConsumptionStatisticsTitle.width, BackConsumptionStatisticsTitle.height)];
    TotalConsumptionTitle.textColor = BackConsumptionStatisticsTitle.textColor;
    TotalConsumptionTitle.text = @"消费结算总额";
    TotalConsumptionTitle.textAlignment = BackConsumptionStatisticsTitle.textAlignment;
    TotalConsumptionTitle.font = BackConsumptionStatisticsTitle.font;
    [showView addSubview:TotalConsumptionTitle];
    
    
    
    /** 消费统计总额*/
    UITextField * TotalConsumptionField = [[UITextField alloc] initWithFrame:CGRectMake(BackConsumptionStatisticsLabel.x, TotalConsumptionTitle.y, BackConsumptionStatisticsLabel.width, BackConsumptionStatisticsLabel.height)];
    [TotalConsumptionField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [TotalConsumptionField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    TotalConsumptionField.keyboardType = UIKeyboardTypeNumberPad;
    TotalConsumptionField.textColor = FontColor;
    TotalConsumptionField.textAlignment = NSTextAlignmentRight;
    [showView addSubview:TotalConsumptionField];
    self.TotalConsumptionField = TotalConsumptionField;
    
    UIView * TotalConsumptionLineView = [[UIView alloc] initWithFrame:CGRectMake(ConsumptionLineView.x, CGRectGetMaxY(TotalConsumptionTitle.frame) + 30 * px, ConsumptionLineView.width, ConsumptionLineView.height)];
    TotalConsumptionLineView.backgroundColor = DividinglineColor;
    [showView addSubview:TotalConsumptionLineView];
    
    
    /** 结算方式*/
    UILabel * SettlementMethodLabel = [[UILabel alloc] initWithFrame:CGRectMake(BackConsumptionStatisticsTitle.x, CGRectGetMaxY(TotalConsumptionLineView.frame) + 30 * px, 200 * px, BackConsumptionStatisticsTitle.height)];
    SettlementMethodLabel.textColor = BackConsumptionStatisticsTitle.textColor;
    SettlementMethodLabel.text = @"结算方式";
    SettlementMethodLabel.textAlignment = BackConsumptionStatisticsTitle.textAlignment;
    SettlementMethodLabel.font = BackConsumptionStatisticsTitle.font;
    [showView addSubview:SettlementMethodLabel];
    
    UIView * MethodView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(SettlementMethodLabel.frame) + 20 * px, SettlementMethodLabel.y, ConsumptionLineView.width - SettlementMethodLabel.x - SettlementMethodLabel.width - 60 * px, showView.height - SettlementMethodLabel.y)];
    MethodView.backgroundColor = [UIColor clearColor];
    [showView addSubview:MethodView];
    
    
    
    

        
        /****************微信 **************/
        /** 选中按钮*/
        UIButton * WeChatButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60 * px, 60 * px)];
        [WeChatButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
        [WeChatButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
        [WeChatButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        [MethodView  addSubview:WeChatButton];
    
    
        /** 微信标题*/
        UILabel * WeChatTitle = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(WeChatButton.frame) + 30 * px, WeChatButton.y, 100 * px, WeChatButton.height)];
        WeChatTitle.textColor = [UIColor blackColor];
        WeChatTitle.text = @"微信";
        WeChatTitle.textAlignment = NSTextAlignmentLeft;
        WeChatTitle.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [MethodView addSubview:WeChatTitle];
    
    
        UITextField * WeChatTextField = [[UITextField alloc] init];
        WeChatTextField.frame = CGRectMake(CGRectGetMaxX(WeChatTitle.frame) + 20 * px, WeChatButton.y, MethodView.width - WeChatButton.width - WeChatTitle.width - 120 * px, WeChatButton.height);
//        WeChatTextField.placeholder = @"请输入手机号";
    
        [WeChatTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
        [WeChatTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
        WeChatTextField.keyboardType = UIKeyboardTypeNumberPad;
        WeChatTextField.textColor = [UIColor blackColor];
        [MethodView addSubview:WeChatTextField];
        self.WeChatTextField = WeChatTextField;
    
    
        UIView *WeChatLine = [[UIView alloc] initWithFrame:CGRectMake(WeChatTextField.x, CGRectGetMaxY(WeChatTextField.frame), WeChatTextField.width, 1)];
        WeChatLine.backgroundColor = DividinglineColor;
        [MethodView addSubview:WeChatLine];
    
    
        /** 微信标题*/
        UILabel * WeChatYLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(WeChatLine.frame) + 20 * px, WeChatButton.y, 50 * px, WeChatButton.height)];
        WeChatYLabel.textColor = WeChatTitle.textColor;
        WeChatYLabel.text = @"元";
        WeChatYLabel.textAlignment = WeChatTitle.textAlignment;
        WeChatYLabel.font = WeChatTitle.font;
        [MethodView addSubview:WeChatYLabel];
    
    
    
    
        /****************刷卡Paybycard**************/
        /** 选中按钮*/
        UIButton * PaybycardButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(WeChatButton.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
        [PaybycardButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
        [PaybycardButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
        [PaybycardButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        [MethodView  addSubview:PaybycardButton];
    
    
        /** 微信标题*/
        UILabel * PaybycardTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, PaybycardButton.y, WeChatTitle.width, WeChatButton.height)];
        PaybycardTitle.textColor = WeChatTitle.textColor;
        PaybycardTitle.text = @"刷卡";
        PaybycardTitle.textAlignment = WeChatTitle.textAlignment;
        PaybycardTitle.font = WeChatTitle.font;
        [MethodView addSubview:PaybycardTitle];
    
    
        UITextField * PaybycardTextField = [[UITextField alloc] init];
        PaybycardTextField.frame = CGRectMake(WeChatTextField.x, PaybycardTitle.y, WeChatTextField.width, WeChatTextField.height);
        //        WeChatTextField.placeholder = @"请输入手机号";
        [PaybycardTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
        [PaybycardTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
        PaybycardTextField.keyboardType = UIKeyboardTypeNumberPad;
        PaybycardTextField.textColor = [UIColor blackColor];
        [MethodView addSubview:PaybycardTextField];
        self.PaybycardTextField = PaybycardTextField;
    
    
        UIView * PaybycardLine = [[UIView alloc] initWithFrame:CGRectMake(PaybycardTextField.x, CGRectGetMaxY(PaybycardTextField.frame), PaybycardTextField.width, WeChatLine.height)];
        PaybycardLine.backgroundColor = DividinglineColor;
        [MethodView addSubview:PaybycardLine];
    
    
        /** 微信标题*/
        UILabel * PaybycardYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, PaybycardButton.y, WeChatYLabel.width, WeChatButton.height)];
        PaybycardYLabel.textColor = WeChatTitle.textColor;
        PaybycardYLabel.text = WeChatYLabel.text;
        PaybycardYLabel.textAlignment = WeChatTitle.textAlignment;
        PaybycardYLabel.font = WeChatTitle.font;
        [MethodView addSubview:PaybycardYLabel];
    
    
    
    
    /****************会员卡支付 Membershipcard**************/
    /** 选中按钮*/
    UIButton * MembershipcardButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(PaybycardButton.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
    [MembershipcardButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
    [MembershipcardButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
    [MembershipcardButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [MethodView  addSubview:MembershipcardButton];
    
    
    /** 微信标题*/
    UILabel * MembershipcardTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, MembershipcardButton.y, 230 * px, WeChatButton.height)];
    MembershipcardTitle.textColor = WeChatTitle.textColor;
    MembershipcardTitle.text = @"会员卡支付";
    MembershipcardTitle.textAlignment = WeChatTitle.textAlignment;
    MembershipcardTitle.font = WeChatTitle.font;
    [MethodView addSubview:MembershipcardTitle];
    
    
    UITextField * MembershipcardTextField = [[UITextField alloc] init];
    MembershipcardTextField.frame = CGRectMake(CGRectGetMaxX(MembershipcardTitle.frame) + 20 * px, MembershipcardTitle.y, MethodView.width - WeChatButton.width - MembershipcardTitle.width - 120 * px, WeChatTextField.height);
    //        WeChatTextField.placeholder = @"请输入手机号";
    [MembershipcardTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [MembershipcardTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    MembershipcardTextField.keyboardType = UIKeyboardTypeNumberPad;
    MembershipcardTextField.textColor = [UIColor blackColor];
    [MethodView addSubview:MembershipcardTextField];
    self.MembershipcardTextField = MembershipcardTextField;
    
    
    UIView * MembershipcardLine = [[UIView alloc] initWithFrame:CGRectMake(MembershipcardTextField.x, CGRectGetMaxY(MembershipcardTitle.frame), MembershipcardTextField.width, WeChatLine.height)];
    MembershipcardLine.backgroundColor = DividinglineColor;
    [MethodView addSubview:MembershipcardLine];
    
    
    /** 微信标题*/
    UILabel * MembershipcardYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, MembershipcardButton.y, WeChatYLabel.width, WeChatButton.height)];
    MembershipcardYLabel.textColor = WeChatTitle.textColor;
    MembershipcardYLabel.text = WeChatYLabel.text;
    MembershipcardYLabel.textAlignment = WeChatTitle.textAlignment;
    MembershipcardYLabel.font = WeChatTitle.font;
    [MethodView addSubview:MembershipcardYLabel];
    
    
    
    
    /****************支付宝 Membershipcard**************/
    /** 选中按钮*/
    UIButton * AlipayButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(MembershipcardButton.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
    [AlipayButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
    [AlipayButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
    [AlipayButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [MethodView  addSubview:AlipayButton];
    
    
    /** 微信标题*/
    UILabel * AlipayTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, AlipayButton.y, 130 * px, WeChatButton.height)];
    AlipayTitle.textColor = WeChatTitle.textColor;
    AlipayTitle.text = @"支付宝";
    AlipayTitle.textAlignment = WeChatTitle.textAlignment;
    AlipayTitle.font = WeChatTitle.font;
    [MethodView addSubview:AlipayTitle];
    
    
    UITextField * AlipayTitleTextField = [[UITextField alloc] init];
    AlipayTitleTextField.frame = CGRectMake(CGRectGetMaxX(AlipayTitle.frame) + 20 * px, AlipayTitle.y, MethodView.width - WeChatButton.width - AlipayTitle.width - 120 * px, WeChatTextField.height);
    //        WeChatTextField.placeholder = @"请输入手机号";
    [AlipayTitleTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [AlipayTitleTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    AlipayTitleTextField.keyboardType = UIKeyboardTypeNumberPad;
    AlipayTitleTextField.textColor = [UIColor blackColor];
    [MethodView addSubview:AlipayTitleTextField];
    self.AlipayTitleTextField = AlipayTitleTextField;
    
    
    UIView * AlipayLine = [[UIView alloc] initWithFrame:CGRectMake(AlipayTitleTextField.x, CGRectGetMaxY(AlipayTitle.frame), AlipayTitleTextField.width, WeChatLine.height)];
    AlipayLine.backgroundColor = DividinglineColor;
    [MethodView addSubview:AlipayLine];
    
    
    /** 微信标题*/
    UILabel * AlipayYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, AlipayButton.y, WeChatYLabel.width, WeChatButton.height)];
    AlipayYLabel.textColor = WeChatTitle.textColor;
    AlipayYLabel.text = WeChatYLabel.text;
    AlipayYLabel.textAlignment = WeChatTitle.textAlignment;
    AlipayYLabel.font = WeChatTitle.font;
    [MethodView addSubview:AlipayYLabel];
    
    
    
    
    /****************现金Cash**************/
    /** 选中按钮*/
    UIButton * CashButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(AlipayButton.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
    [CashButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
    [CashButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
    [CashButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [MethodView  addSubview:CashButton];
    
    
    /** 微信标题*/
    UILabel * CashTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, CashButton.y, WeChatTitle.width, WeChatButton.height)];
    CashTitle.textColor = WeChatTitle.textColor;
    CashTitle.text = @"现金";
    CashTitle.textAlignment = WeChatTitle.textAlignment;
    CashTitle.font = WeChatTitle.font;
    [MethodView addSubview:CashTitle];
    
    
    UITextField * CashTextField = [[UITextField alloc] init];
    CashTextField.frame = CGRectMake(WeChatTextField.x, CashTitle.y, WeChatTextField.width, WeChatTextField.height);
    //        WeChatTextField.placeholder = @"请输入手机号";
    [CashTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [CashTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    CashTextField.keyboardType = UIKeyboardTypeNumberPad;
    CashTextField.textColor = [UIColor blackColor];
    [MethodView addSubview:CashTextField];
    self.CashTextField = CashTextField;
    
    
    UIView * CashLine = [[UIView alloc] initWithFrame:CGRectMake(PaybycardTextField.x, CGRectGetMaxY(CashTextField.frame), WeChatTextField.width, WeChatLine.height)];
    CashLine.backgroundColor = DividinglineColor;
    [MethodView addSubview:CashLine];
    
    
    /** 微信标题*/
    UILabel * CashYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, CashButton.y, WeChatYLabel.width, WeChatButton.height)];
    CashYLabel.textColor = WeChatTitle.textColor;
    CashYLabel.text = WeChatYLabel.text;
    CashYLabel.textAlignment = WeChatTitle.textAlignment;
    CashYLabel.font = WeChatTitle.font;
    [MethodView addSubview:CashYLabel];
    
    
    
    
    /****************挂账Accounts**************/
    /** 选中按钮*/
    UIButton * AccountsButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(CashButton.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
    [AccountsButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
    [AccountsButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
    [AccountsButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [MethodView  addSubview:AccountsButton];
    
    
    /** 微信标题*/
    UILabel * AccountsTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, AccountsButton.y, WeChatTitle.width, WeChatButton.height)];
    AccountsTitle.textColor = WeChatTitle.textColor;
    AccountsTitle.text = @"挂账";
    AccountsTitle.textAlignment = WeChatTitle.textAlignment;
    AccountsTitle.font = WeChatTitle.font;
    [MethodView addSubview:AccountsTitle];
    
    
    UITextField * AccountsTextField = [[UITextField alloc] init];
    AccountsTextField.frame = CGRectMake(WeChatTextField.x, AccountsTitle.y, WeChatTextField.width, WeChatTextField.height);
    //        WeChatTextField.placeholder = @"请输入手机号";
    [AccountsTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [AccountsTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    AccountsTextField.keyboardType = UIKeyboardTypeNumberPad;
    AccountsTextField.textColor = [UIColor blackColor];
    [MethodView addSubview:AccountsTextField];
    self.AccountsTextField = AccountsTextField;
    
    UIView * AccountsLine = [[UIView alloc] initWithFrame:CGRectMake(PaybycardTextField.x, CGRectGetMaxY(AccountsTextField.frame), WeChatTextField.width, WeChatLine.height)];
    AccountsLine.backgroundColor = DividinglineColor;
    [MethodView addSubview:AccountsLine];
    
    
    /** 微信标题*/
    UILabel * AccountsYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, AccountsButton.y, WeChatYLabel.width, WeChatButton.height)];
    AccountsYLabel.textColor = WeChatTitle.textColor;
    AccountsYLabel.text = WeChatYLabel.text;
    AccountsYLabel.textAlignment = WeChatTitle.textAlignment;
    AccountsYLabel.font = WeChatTitle.font;
    [MethodView addSubview:AccountsYLabel];
    
    
    
    /****************挂账Accounts**************/
    /** 选中按钮*/
    UIButton * ZhaodaiButton = [[UIButton alloc] initWithFrame:CGRectMake(WeChatButton.x, CGRectGetMaxY(AccountsTitle.frame) + 40 * px, WeChatButton.width, WeChatButton.height)];
    [ZhaodaiButton  setImage:[UIImage imageNamed:@"筛选-未选中"] forState:UIControlStateNormal];
    [ZhaodaiButton  setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateSelected];
    [ZhaodaiButton  addTarget:self action:@selector(WeChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [MethodView  addSubview:ZhaodaiButton];
    self.ZhaodaiButton = ZhaodaiButton;
    
    
    /** 微信标题*/
    UILabel * ZhaodaiTitle = [[UILabel alloc] initWithFrame:CGRectMake(WeChatTitle.x, ZhaodaiButton.y, WeChatTitle.width, WeChatButton.height)];
    ZhaodaiTitle.textColor = WeChatTitle.textColor;
    ZhaodaiTitle.text = @"招待";
    ZhaodaiTitle.textAlignment = WeChatTitle.textAlignment;
    ZhaodaiTitle.font = WeChatTitle.font;
    [MethodView addSubview:ZhaodaiTitle];
    
    
    
    UITextField * ZhaodaiTextField = [[UITextField alloc] init];
    ZhaodaiTextField.frame = CGRectMake(WeChatTextField.x, ZhaodaiTitle.y, WeChatTextField.width, WeChatTextField.height);
    //        WeChatTextField.placeholder = @"请输入手机号";
    ZhaodaiTextField.enabled = NO;
    [ZhaodaiTextField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    [ZhaodaiTextField setValue:[UIFont systemFontOfSize:SYRealValue(35 / 2)] forKeyPath:@"_placeholderLabel.font"];
    ZhaodaiTextField.keyboardType = UIKeyboardTypeNumberPad;
    ZhaodaiTextField.textColor = [UIColor blackColor];
    [MethodView addSubview:ZhaodaiTextField];
    self.zhaodaiTextField = ZhaodaiTextField;
    
    
    /** 微信标题*/
    UILabel * zhaodaiYLabel = [[UILabel alloc] initWithFrame:CGRectMake(WeChatYLabel.x, ZhaodaiTitle.y, WeChatYLabel.width, WeChatButton.height)];
    zhaodaiYLabel.textColor = WeChatTitle.textColor;
    zhaodaiYLabel.text = WeChatYLabel.text;
    zhaodaiYLabel.textAlignment = WeChatTitle.textAlignment;
    zhaodaiYLabel.font = WeChatTitle.font;
    [MethodView addSubview:zhaodaiYLabel];
//
    UIView * ZhaodaiLine = [[UIView alloc] initWithFrame:CGRectMake(ZhaodaiTextField.x, CGRectGetMaxY(ZhaodaiTextField.frame), ZhaodaiTextField.width, WeChatLine.height)];
    ZhaodaiLine.backgroundColor = DividinglineColor;
    [MethodView addSubview:ZhaodaiLine];
}


- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:NO];
}

- (void)BackButtonClick{
    WYCLogFunc;
    [self.backView removeFromSuperview];
}

- (void)WeChatButtonClick:(UIButton *)sender{
    
    sender.selected = !sender.selected;
}
@end
